import Vue from 'vue'
import VueRouter from 'vue-router'
import VideoPlay from '../views/VideoPlay.vue'
import MovieView from '../views/MovieView.vue'
import MyView from '../views/MyView.vue'
import VideoView from '../views/VideoView.vue'
import NewVideoView from '../views/NewVideoView.vue'
import SearchMovieList from '../components/SearchList/SearchMovieList.vue'
import SearchCinemaList from '../components/SearchList/SearchCinemaList.vue'
import DetailOfMovie from '../components/CnimaAndMovie/DetailOfMovie'
import CinemaDetail from "../components/Cinema/CinemaDetail.vue";
import filmView from "../components/filmeInfo/filmView.vue"
import Choose from "../components/Cinema/Choose.vue";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name:'movie',
    meta:{keepAlive:true},
    component: MovieView
  },
  {
    path: '/video',
    meta:{keepAlive:true},
    component: NewVideoView,
  },
  {
    path: '/svideo',
    meta:{keepAlive:true},
    component: VideoView,
  },
  {
    path: '/my',
    meta:{keepAlive:true},
    component: MyView,
  },
  {
    path: '/searchmovielist',
    name:'searchmovielist',
    meta:{keepAlive:true},
    props:true,
    component: SearchMovieList,
  },
  {
    path: '/searchcinemalist',
    name:'searchcinemalist',
    meta:{keepAlive:true},
    props:true,
    component:SearchCinemaList,
  },
  {
    path:'/play',
    name:'videoplay',
    meta:{keepAlive:true},
    component:VideoPlay,
    props($route){
      return {
        vlist:$route.params.vlist
      }
    },
  },
  {
    path: '/dMovie',
    name: 'dMovie',
    component:DetailOfMovie,
    meta:{keepAlive:true},
    props($route){
      return {
        movieId:$route.params.id
      }
    }
  },
  {
    path: '/cinemadetail',
    name: 'cinemadetail',
    meta:{keepAlive:true},
    component:CinemaDetail,
    props($route){
      return {
        id:$route.params.todsid
      }
    }
  },
  {
    path: '/filmview',
    name: 'filmview',
    meta:{keepAlive:true},
    component:filmView,
    props($route){
      return {
        id:$route.params.movieId
      }
    }
  },
  {
    path: '/choose',
    name: 'choose',
    meta:{keepAlive:true},
    component:Choose,
    props($route){
      return {
        titles:$route.params.titles,
        list:$route.params.list,
        name:$route.params.name
      }
    }
  },

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
